<?php
include 'inc/config.inc';
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
	die('Failed to connect to server: ' . mysql_error());
}

//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
	die("Unable to select database");
}
$query = mysql_query("UPDATE perm_members set role='".$_POST['role']."' WHERE id='".$_POST['id']."'");
$select_role = mysql_query("SELECT role FROM perm_members WHERE id='".$_POST['id']."'");
$role_row = mysql_fetch_array($select_role);
if($query){
	echo ucfirst($role_row[0]);
	?> 
	[<a href="javascript:void()" id="change_linkl<?php echo $_POST['id']; ?>">change</a>]
	<?php
}
?>